﻿using IBM.MQ.Test.Models;
using IBM.WMQ;
using NLog;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;

namespace IBM.MQ.Test
{
    class Program
    {

        static void Main(string[] args)
        {
            //测试
            //var manager = new MyIBMQueueManager()
            //{
            //    Host = "192.168.171.151",
            //    Port = 6000,
            //    Channel = "IE.SVRCONN",
            //    QueueManagerName = "GWO.QM",
            //    QueueName = "OUT.S301.MS000.LQ"
            //};
            //正式
            //人员服务ID：MS024
            //科室服务ID：MS025
            var manager = new MyIBMQueueManager()
            {
                Host = "192.168.171.35",
                Port = 6000,
                Channel = "IE.SVRCONN",
                QueueManagerName = "GWO.QM",
                QueueName = "OUT.S611.MS000.LQ"
            };

            //XmlDocument doc = new XmlDocument();
            //doc.Load("人员字典(新).xml");

            while (true)
            {
                try
                {
                    manager.Connect();

                    while (true)
                    {
                        manager.GetMessage();
                    }

                }
                catch
                {
                    Thread.Sleep(30000);
                }
            }
            //manager.LoadXml(doc.InnerXml);

            Console.ReadLine();
        }
    }

}
